home *** CD-ROM | disk | FTP | other *** search
- // This script will go through a message one character at a
- // time and change the caps of that character. It
- // looks neat but if in a non fixed type font, it will
- // lose some of the effect. Set "speedtogo" higher to
- // go slower and lower to go faster. Set a[1] and a[2]
- // to the sets of alternating caps you want. I have
- // chosen a[1] to be all small and a[2] to be all big
- // but you can set then to anything. Just make sure
- // you have them reversed in the a[2] or you will
- // lose effect.
-
-
- // Enjoy.
-
- var count = -1;
- var counter;
- var nchar
- var speedtogo = 200
-
- var a = new Array();
-
- a[1] = "ZHANG MING YAO";
- a[2] = "zhang ming yao";
-
- function capswitch() {
- count++
- if(count == 0){
- document.wow.display.value = a[1]
- }
- if(count == 1){
- document.wow.display.value = a[2].substring(0, 1) +
- a[1].substring(22, 1)
- }
- if(count > 1){
- a[3] = a[1].substring(0, count - 1) + a[2].substring(count - 1,
- count) + a[1].substring(22, count)
- document.wow.display.value = a[3]
- }
- if(count == a[1].length){
- count = -1
- }
-
- counter = setTimeout("capswitch()",speedtogo);
-
- }
-
- document.write("<FORM NAME=\"wow\">");
- document.write("<INPUT TYPE=\"TEXT\" NAME=\"display\" SIZE=\"22\">");
- document.write("</FORM>");
- capswitch();